#include "linkstack.h"

int main() {
    LinkStack s;
    if (!InitStack(&s)) {
        printf("InitStack failed!\n");
        return 0;
    }

    ElemType e;
    if (!GetTop(&s, &e)) {
        printf("GetTop failed!\n");
    } else {
        printf("GetTop %d\n", e);
    }

    push(&s, 1);
    printf("push 1\n");
    push(&s, 2);
    printf("push 2\n");
    push(&s, 3);
    printf("push 3\n");
    push(&s, 4);
    printf("push 4\n");

    pop(&s, &e);
    printf("pop %d\n", e);
    pop(&s, &e);
    printf("pop %d\n", e);

    push(&s, 5);
    printf("push 5\n");
    push(&s, 6);
    printf("push 6\n");

    if (!GetTop(&s, &e)) {
        printf("GetTop failed!\n");
    } else {
        printf("GetTop %d\n", e);
    }

    return 0;
}